package nix.anim.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import nix.anim.common.pojo.NixResult;
import nix.anim.service.MenuService;

/**
 * 菜单管理Controller
 */
@Controller
public class MenuController {

	@Autowired
	private MenuService menuService;
	
	@Value("${ROOT_MENU_ID}")
	private Integer ROOT_MENU_ID;
	
	@RequestMapping(value="/api/menu/tree", method=RequestMethod.GET)
	@ResponseBody
	public NixResult getMenuTree() {	
		// 调用服务		
		NixResult result = menuService.getMenuTree(ROOT_MENU_ID);
		return result;
	}
	
}
